package org.ichow.scenegame.notis
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.SimpleButton;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import org.ichow.scenegame.events.NotiEvent;

	/**
	 * ...
	 * @author M.ichow
	 */
	public class GameInfoNoti extends BaseNoti
	{
		private var __startBtn : DisplayObject;
		
		public function GameInfoNoti()
		{
			super();
		}

		override protected function init() : void
		{
			super.init();
			if ( _noti is DisplayObjectContainer )
				__startBtn = ( _noti as DisplayObjectContainer ).getChildByName( "continue_btn" );
		}

		override protected function addListeners() : void
		{
			super.addListeners();
			if ( __startBtn && !__startBtn.hasEventListener(MouseEvent.CLICK) )
				__startBtn.addEventListener( MouseEvent.CLICK , onContinueMouseClick );
		}
		
		private function onContinueMouseClick( e : MouseEvent ) : void
		{
			var evt:NotiEvent = new NotiEvent(NotiEvent.NOTI_CHANGE);
			evt.status = NotiEvent.PLAY;
			dispatchEvent( evt );
			cancel();
		}

	}

}